import 'package:agro_sklad_new/feature/presentations/home/controller/state.dart';
import 'package:get/get.dart';
import 'package:flutter_bloc/flutter_bloc.dart';

import '../../../domain/usercases/get_all_stock.dart';

class HomeCubit extends Cubit<HomeState> {
  final GetAllStock getAllStock;
  HomeCubit({required this.getAllStock}): super (const Initial());

  void init() async {
    final failureStock = await getAllStock(StockParams());
    print(failureStock);
    emit(const Home());
  }
  void openFact(){
    Get.toNamed('/fact');
  }
  void openTasks(){
    Get.toNamed('/task');
  }
  void openReports(){
    Get.toNamed('/reports');
  }
  void openSettings(){
    Get.toNamed('/settings');
  }
  void back(){
    Get.back();
  }
  void error(){

  }

}